package com.catsic.mod.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.catsic.base.BaseEntity;
import com.catsic.core.entity.User;

/**
 * @author cs
 * 发件箱实体类
 */
@Entity
@Table(name="S_SENDMESSAGE")
public class SendMessage extends BaseEntity implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -2954827975967996307L;
	

	/**
	 * 标题
	 */
	@Column(name="TITLE")
	private String title;
	
	/**
	 * 内容
	 */
	@Column(name="CONTENT")
	private String content;
	
	/**
	 * 发送人(用户)
	 */
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="USERID",referencedColumnName = "ID")
	private User user;

	/**
	 * 收件
	 **/
	@OneToMany(cascade=CascadeType.REMOVE,fetch = FetchType.LAZY,mappedBy="sendMessage") 
	private List<ReceiveMessage> receiveMessages;
	
	/**
	 * 
	 * 手机提醒
	 */
	@Column(name="REMIND")
	private String remind;
	

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<ReceiveMessage> getReceiveMessages() {
		return receiveMessages;
	}

	public void setReceiveMessages(List<ReceiveMessage> receiveMessages) {
		this.receiveMessages = receiveMessages;
	}

	public String getRemind() {
		return remind;
	}

	public void setRemind(String remind) {
		this.remind = remind;
	}

	
}
